import * as React from "react";
import { RouteComponentProps } from "react-router";
import SearchAndFilter from "../../component/SearchAndFilter";
import { doctorDept, doctorPosition } from "../../config/DoctorFilter";
import { IfilterParam } from "../../type/CommonData";
import DoctorList from "./DoctorList";


interface Iprops extends RouteComponentProps<any> {}

class DoctorOrder extends React.Component<Iprops> {
  public chlid: any;
  public getData = (param: IfilterParam) => {
    this.chlid.props.getData(param);
  };
  public chlidrenLoad = (chlid: any) => {
    this.chlid = chlid;
  };
  public render() {
    return (
      <div>
        <SearchAndFilter
          arrayOne={doctorPosition}
          arrayTwo={doctorDept}
          filterCallback={this.getData}
          filterOne={"医生职称"}
          filterTwo={"所属科室"}
          Placeholder={"请输入医生名字"}
        />
        <DoctorList loadParent={this.chlidrenLoad} />
      </div>
    );
  }
}

export default DoctorOrder;
